﻿#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <stdlib.h>
#include<string.h>
#include<stdlib.h>

typedef struct node
{
    int data;
    struct node* next;
}LNode;

void Insert(LNode* head, int x)
{
    LNode* newnode = (LNode*)malloc(sizeof(LNode));
    newnode->next = NULL;
    newnode->data = x;
    LNode* tail = head;
    while(tail->next)
    head->next = newnode;
}

void destroy(LNode* head)
{
    LNode* cur;
    cur = head;
    while (cur != NULL)
    {
        LNode* temp = cur;
        cur = cur->next;
        free(temp);
    }
}

void PrintList(LNode* head, int count)
{
    LNode* cur = head->next;
    int i = 0;
    while (cur != NULL)
    {
        if (cur->data % 2 == 0)
        {
            printf("%d", cur->data);
            i++;
            if (i < count)
                printf("  ");
            else
                printf("\n");
        }
        cur = cur->next;
    }
}

int search(LNode* head)
{
    LNode* cur = head->next;
    int count = 0;
    while (cur != NULL)
    {
        if (cur->data % 2 == 0)
        {
            count++;
        }
        cur = cur->next;
    }
    return count;
}





int main()

{

    int n, i, x, count = 0;

    while (scanf("%d", &n) != EOF)



    {

        LNode* head = (LNode*)malloc(sizeof(LNode));

        head->next = NULL;

        for (i = 0;i < n;i++)

        {

            scanf("%d", &x);

            Insert(head, x);

        }
        count = search(head);
        PrintList(head,count);
        printf("%d", count);

        destroy(head);



    }

    return 0;

}


